# -*- coding: utf-8 -*-
from django.conf import settings

def sns(request):
    return {
        'on_sns': request.on_sns,
        'on_xiaonei': request.on_xiaonei,
        'on_51': request.on_51,
        'SERVER_URL': settings.SERVER_URL,
        'site_name':u'连续剧中心',
    }
    
def debug(request):
    "Returns context variables helpful for debugging."
    context_extras = {}
    context_extras['is_developer'] = hasattr(request.user, 'uid') and request.user.uid in settings.DEVELOPER_UIDS
    if settings.DEBUG or (hasattr(request.user, 'uid') and request.user.uid in settings.DEVELOPER_UIDS):
        context_extras['debug'] = True
        from django.db import connection
        context_extras['sql_queries'] = connection.queries
    return context_extras